#include<bits/stdc++.h>
//#define int long long
using namespace std;
namespace AC{
int cnt[100010],sum[100010];
void solve(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        cnt[x]++;
        sum[x]++;
    }
    for(int i=1;i<100010;i++)sum[i]+=sum[i-1];
    int c=0,ans=0;
    for(int i=1;i<100010;i++){
        int tmp=min(sum[i-1]-ans,cnt[i]);
        ans+=tmp;
    }
    cout<<n-ans;
}
}
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int t=1;
    //cin>>t;
    while(t--)AC::solve();
}